package com.umakr.ax.opt.web;

import com.umakr.ax.common.model.AreaRs;
import com.umakr.ax.core.base.AbstractController;
import com.umakr.ax.opt.service.AreaRsOptService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 * ${table.comment}  前端控制器
 * </p>
 *
 * @author Umakr-Code-Generator
 * @since 2017-12-30
 */
@Controller
@RequestMapping("/api/opt/areaRs")
public class AreaRsOptController extends AbstractController {

	@Autowired
	AreaRsOptService areaRsOptService;



	@ApiOperation(value = "删除电台地区")
	@GetMapping("/delAreaRs")
	@ResponseBody
	public Object delAreaRs(ModelMap modelMap,@RequestParam(name = "id") Long id) {
		return setSuccessModelMap(modelMap,areaRsOptService.delAreaRs(id));
	}

	@ApiOperation(value = "电台地区列表")
	@GetMapping("/listAreaRs")
	@ResponseBody
	public Object listAreaRs(ModelMap modelMap,@RequestParam(name = "rsId") Long rsId) {
		return setSuccessModelMap(modelMap,areaRsOptService.listAreaRs(rsId));
	}

	@ApiOperation(value = "新增或者修改电台地区")
	@GetMapping("/saveOrUpdateAreaRs")
	@ResponseBody
	public Object saveOrUpdateAreaRs(ModelMap modelMap,AreaRs areaRs) {
		return setSuccessModelMap(modelMap,areaRsOptService.saveOrUpdateAreaRs(areaRs));
	}

	

}